package code;

/**
 * @author
 *
 * This class represents the tree node object
 */
public class TreeNode {
	private TreeNode left;
	private TreeNode middle;
	private TreeNode right;
	private String label;
	private String message;
	private String prompt;
	public TreeNode(){
		left = null;
		middle = null;
		right = null;
	}
	public TreeNode getLeft() {
		return left;
	}
	public void setLeft(TreeNode left) {
		this.left = left;
	}
	public TreeNode getMiddle() {
		return middle;
	}
	public void setMiddle(TreeNode middle) {
		this.middle = middle;
	}
	public TreeNode getRight() {
		return right;
	}
	public void setRight(TreeNode right) {
		this.right = right;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getPrompt() {
		return prompt;
	}
	public void setPrompt(String prompt) {
		this.prompt = prompt;
	}
	/**
	 * 
	 * @return  true if the node is a leaf
	 */
	public boolean isLeaf(){
		return this.left==null && this.middle==null && this.right==null;
	}
	public String toString(){
		return "Label: "+label+"\n"+"Prompt: "+prompt+"\n"+"Message: "+message;
	}
}
